import React from 'react';
import classNames from 'classnames';

interface IconTextBtnProps {
  icon: string;
  text: string;
  disabled?: boolean;
  onClick?: Function;
  className?: string;
}
const IconTextBtn = (props: IconTextBtnProps) => {
  const { icon, text, disabled, onClick, className } = props;
  return (
    <div
      className={classNames('flex items-center', className, {
        'text-color': !disabled,
        'text-color-thirdly default': disabled,
        'text-color-hover pointer': onClick && !disabled,
      })}
      onClick={() => !disabled && onClick && onClick()}
    >
      <span className={`iconfont ${icon}`}></span>
      <span className="ml4 fsz13">{text}</span>
    </div>
  );
};

export default IconTextBtn;
